-
Notifications
You must be signed in to change notification settings - Fork 220
Add deprecation warning to S3 GetBucketLocation operation #4348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add DeprecatedTrait to GetBucketLocation operation in S3Decorator - Include message recommending HeadBucket as the preferred alternative - Add comprehensive unit tests to verify deprecation behavior - Add integration test to verify generated Rust code includes #[deprecated] attribute This addresses customer feedback that GetBucketLocation is marked as deprecated in AWS documentation but not in the Rust SDK.
A new generated diff is ready to view.
A new doc preview is ready to view. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, couple small comments, but no major blocker. Lets hold off on merging to see if we can get this change into the actual S3 model though.
aws/codegen-aws-sdk/src/main/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3Decorator.kt
Outdated
Show resolved
Hide resolved
...degen-aws-sdk/src/test/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3DecoratorTest.kt
Outdated
Show resolved
Hide resolved
- Changed createDeprecatedTrait() to take message as parameter - Updated deprecatedOperations from Set to Map for message storage - Removed integration test per code review feedback
A new generated diff is ready to view.
A new doc preview is ready to view. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Left minor comments.
@Test | ||
fun `Other S3 operations do not have DeprecatedTrait`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also remove this test (as well as relevant operations from the test model), as long as we are testing GetBucketLocation
to be annotated for deprecation. Since there are many other S3 operations in the real world, the fact this test passed doesn't necessarily guarantee those operations are without deprecated annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general tip, if these are only format changes, I'd keep the one in main and not include it in the PR (as long as precommit hook is ok). It'll be hard to distinguish between the real changes vs. format changes.
Motivation and Context
It is reported that the S3 GetBucketLocation operation is marked as deprecated in the AWS S3 documentation, but the Rust SDK doesn't reflect this deprecation with a compiler warning.
The AWS documentation recommends using HeadBucket instead to determine a bucket's region.
Description
This PR adds the Smithy @deprecated trait to the GetBucketLocation operation in the S3Decorator, which generates a Rust #[deprecated] attribute in the SDK.
Changes:
Deprecation Message:
Testing
Checklist
.changelog
directory, specifying "client," "server," or both in theapplies_to
key..changelog
directory, specifying "aws-sdk-rust" in theapplies_to
key.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.